//
//  ExamineProprietorPositionInternetView.swift
//  SmartHousekeeper
//
//  Created by 张磊 on 2020/2/21.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit
//绑定完成
class ExamineProprietorPositionInternetView: UIView {
    typealias ExamineProprietorPositionInternetView = ()->()
    public var nextInternetBlock : ExamineProprietorPositionInternetView? = nil
    
    lazy var nextBtn : UIButton = {
        let value = UIButton(textColor: .white, textFont: UIFont.boldSystemFont(ofSize: Adapter(17)))
        value.setTitle("完成", for: .normal)
        value.backgroundColor = RGBColor(r: 62, g: 134, b: 230, a: 1)
        value.layer.cornerRadius = Adapter(8)
        value.layer.masksToBounds = true
        return value
    }()
    
    
    required init?(coder: NSCoder) {
        super .init(coder: coder)
    }
    override init(frame: CGRect) {
        super .init(frame: frame)
        setUI()
    }
    private func setUI(){
        
        let successGet = UILabel(textColor: RGBColor(r: 94, g: 94, b: 94, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(22)))
        successGet.text = "核验成功"
        self .addSubview(successGet)
        successGet.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.centerY.equalToSuperview().offset(Adapter(-80))
            
        }
        
        let information = UILabel(textColor: RGBColor(r: 116, g: 116, b: 116, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(15)))
        information.text = "系统将自动开通业主\n服务卡功能"
        information.numberOfLines = 0
        information.textAlignment = .center
        self .addSubview(information)
        information.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(successGet.snp.bottom).offset(Adapter(15));
        }
        
        let imgLogo = UIImageView(image: UIImage(named: "icon_success"))
        self.addSubview(imgLogo)
        imgLogo.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.bottom.equalTo(successGet.snp.top).offset(-Adapter(15));
            make.size.equalTo(CGSize(width: Adapter(50), height: Adapter(50)))
            
        }
        self.addSubview(nextBtn)
        nextBtn.snp.makeConstraints { (make) in
            make.bottom.equalToSuperview().offset(Adapter(-50))
            make.height.equalTo(Adapter(45))
            make.left.equalToSuperview().offset(Adapter(50))
            make.right.equalToSuperview().offset(Adapter(-50))
        }
        
        nextBtn.sce.add(.touchUpInside) { (btn) in
            if self.nextInternetBlock != nil {
                self.nextInternetBlock!()
            }
        }
    }
    
}
